package com.core.resp;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author : HUANG
 * @create : 2025/5/31 22:43
 * @function :
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AjaxResponse implements Serializable {
    private String msg;
    private Integer code;
    private Object data;

    public static AjaxResponse success(int code, String msg, Object data) {
        return new AjaxResponse(msg, code, data);
    }

    public static AjaxResponse error(int code, String msg) {
        return new AjaxResponse(msg, code, null);
    }
}
